# Maintainer: Ivan Semkin (ivan at semkin dot ru)

pkgname=url-dispatcher-git
_pkgname=url-dispatcher
pkgver=r735.b9a83f5
pkgrel=1
pkgdesc='Service to allow sending of URLs and get handlers started'
url='https://github.com/ubports/url-dispatcher'
arch=(x86_64 i686 armv7h aarch64)
license=(LGPL)
conflicts=(url-dispatcher)
provides=(url-dispatcher)
depends=(ubuntu-app-launch-git intltool apparmor)
makedepends=(git cmake cmake-extras-git dbus-test-runner lcov gcovr gmock)
checkdepends=(python-testtools python-nose python-dbusmock)
source=('git+https://github.com/ubports/url-dispatcher.git'
        'no-discarded-qualifiers.patch')
sha256sums=('SKIP'
            'acffad6f0cf98faedea4c4ef917e0fcca3f5faa61d95afb55f617ff94ff32d51')

prepare() {
  cd ${_pkgname}
  git checkout bionic

  sed -i 's/-Wall/-Wall -Wno-deprecated-declarations/g' CMakeLists.txt
  patch -Np1 -i "${srcdir}/no-discarded-qualifiers.patch"
}

pkgver() {
  cd ${_pkgname}
  echo "r$(git rev-list --count HEAD).$(git describe --always)"
}

build() {
  cd ${_pkgname}
  cmake -DCMAKE_INSTALL_PREFIX:PATH=/usr -DCMAKE_INSTALL_LIBDIR="lib/" -DCMAKE_INSTALL_LIBEXECDIR="lib/" .
  make
}

check() {
  cd ${_pkgname}
  make ARGS+="--output-on-failure" test
}

package() {
  cd ${_pkgname}
  make DESTDIR="${pkgdir}/" install
}
# vim:set ts=2 sw=2 et:
